#ifndef _PROCESS_STATS_H
#define _PROCESS_STATS_H

#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <malloc_align.h>
#include <csp_shared_types.h>
#include <ProcessComposition.h>
#include <vector>
#include <map>

using namespace std;
class ProcessStats
{
	public:
		~ProcessStats();
		static ProcessStats* Instance();
		void RegisterExpectedRes(ProcessComposition *p, int expected_res);
		void SetExpectedTerminatedProcesses(int _p_count){p_count = _p_count;}

		void Check();

	protected:
		ProcessStats();
		ProcessStats(const ProcessStats&);
		ProcessStats& operator= (const ProcessStats&);

	private:

		bool CheckTerminationValues();
		bool CheckNumberOfTerminatedProcesses();
		bool CheckPids();

		static ProcessStats* pinstance;
		pthread_mutex_t lock;
		vector< pair<ProcessComposition*, int>* > process_vector;
		int p_count;
};

#endif
